package com.tengju.data.infrastructure.persistence.mybatis.mapper.tengju.custom;


import com.tengju.data.infrastructure.persistence.mybatis.dataobject.AchievementBonusDO;
import com.tengju.data.infrastructure.persistence.mybatis.dataobject.AchievementBonusLogDO;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;

public interface AchievementBonusLogDOCustomMapper {

    List<AchievementBonusDO> listWithPage(@Param("logTime") LocalDateTime logTime,
                                          @Param("month") Integer month,
                                          @Param("offset") Integer offset,
                                          @Param("limit") Integer limit);

    List<AchievementBonusDO> listByUsers(@Param("logTime") LocalDateTime logTime,
                                         @Param("month") Integer month,
                                         @Param("idCodeList") List<Long> idCodeList);

    int count(@Param("logTime") LocalDateTime logTime, @Param("month") Integer month);

    List<AchievementBonusDO> listByParents(@Param("logTime") LocalDateTime logTime,
                                           @Param("month") Integer month,
                                           @Param("pIdCodeList") List<Long> pIdCodeList);

    List<AchievementBonusDO> listBySettleParents(@Param("logTime") LocalDateTime logTime,
                                                 @Param("month") Integer month,
                                                 @Param("teamRatioType") Integer teamRatioType,
                                                 @Param("settlePIdCodeList") List<Long> settlePIdCodeList);

    LocalDateTime queryMaxLogTime(@Param("idCode") Long idCode,@Param("month") Integer month);

    List<HashMap<String, Object>> listLogTimeWithMonth();

    void archive(@Param("logTime") LocalDateTime logTime,
                 @Param("archiveTableName") String archiveTableName);

    void deleteWithLogTime(@Param("logTime") LocalDateTime logTime);

    List<AchievementBonusLogDO> listWithRange(@Param("idCode") long idCode, @Param("month") int month, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);

    List<LocalDateTime> queryLogTime(@Param("idCode") long idCode,
                                     @Param("month") long month,
                                     @Param("startTime") LocalDateTime startTime,
                                     @Param("endTime") LocalDateTime endTime);

}